<?php

class ToolbaseApiActions extends sfActions {
       
        public function getDB( $lang = 'en', $wiki = 'wikipedia' ) {
                $user = sfContext::getInstance()->getUser();
               
                try {
                        $db = ToolDB::get( $lang, $wiki );
                }
                catch( ToolDBException $e ) {
                        return array( 'error' => array( 'code' => 'dberror', 'info' => $e->getMessage() ) );                    
                }
               
                return $db;
        }
       
       
}
